package com.study.customer.controller;

import com.study.customer.pojo.GameGoods;
import com.study.customer.service.GameGoodsService;
import org.hibernate.annotations.Cache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * customer服务向外暴露的goods_api
 * 功能介绍：浏览所有货品
 * @author peng
 */
@RestController
@RequestMapping("/gameGoods")
public class GameGoodsController {
    @Autowired
    private GameGoodsService gameGoodsService;

    /**
     * 查询所有游戏货品
     *
     * @return
     */
    @Cacheable(value = "customerGoodsCache")
    @GetMapping
    public List<GameGoods> findAll() {
        return gameGoodsService.findAll();
    }
}
